package com.wangtongxiao.controller;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
@RequestMapping("/session")
public class MySession {
    @RequestMapping("/set.action")
        public String set(HttpSession session){
            session.setAttribute("a","123");
            return "session设置";
        }
@RequestMapping("get.action")
        public  String get(HttpSession httpSession){
            String s = (String)httpSession.getAttribute("a");
            return s;
        }
}
